package com.powernode.springmvc.controller;

import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;

/**
 * @Author: 曾铖坚
 * @Date: 2024/10/8 21:54
 * @Version: 1.0.0
 */
@ControllerAdvice
public class ExceptionController {
    @ExceptionHandler
    public String tip(Exception e, Model model) {
        model.addAttribute("yichang", e);
        return "tip";
    }
}
